package com.googlecode.nls4j;

import java.util.Locale;

/**
 * NlsKey is an identifier of a locale-sensitive resource.
 * 
 * @param <V>
 *            type of the resource identified by this NlsKey.
 * @author Andrey Pavlenko
 */
public interface NlsKey<V> {

    /**
     * Returns a string representation (or name) of this NlsKey. <br/>
     * <b>Note:</b> if two keys are equals, the names of these keys must also be
     * equals (i.e. k1.equals(k2) && k1.getName().equals(k2.getName())).
     */
    public String getName();

    /**
     * Returns the default resource identified by this NlsKey and the specified
     * locale. This method is used to provide a default resource if no
     * localization is found for the specified locale.<br/>
     * <b>Note:</b> this method must always returns the same resource for the
     * same locale (i.e. locale1.equals(locale2) &&
     * getDefaultValue(locale1).equals(getDefaultValue(locale2))).
     */
    public V getDefaultValue(Locale locale);
}
